﻿package com.dg.gaming.api.common.util{

	/**
	 * ...
	 * @author 
	 */
	public class GameLabels extends AbstractProperties {

		// name of the lookandfeel properties file
		private static const DEFAULT_FILENAME:String="labels";
		private static const CLIENT_TITLE:String="dg.client.title";
		private static const TABLE_TITLE:String="dg.table.title";
		private static const WELCOME_MESSAGE:String="dg.client.welcome.message";
		private static const PLAYER_LABEL:String="player.label.";
		private static const KEY_RULES_FILENAME:String="rules.file";
		private static const GAME_LABEL:String="game.label";

		private static var instance:GameLabels=null;

		/**
		 * Private constructor (Can only be called by the getInstance() method.
		 */
		public function GameLabels() {
			super(DEFAULT_FILENAME);
		}

		/**
		 * Accessor to singleton instance of this class.
		 *
		 * @return  instance of GameLabels
		 */
		public static function getInstance():GameLabels {
			if (instance==null) {
				instance=new GameLabels  ;
			}

			return instance;
		}

		/**
		 * Return the color of a player (each player has a specific colour which
		 * is used throughout the API).
		 *
		 * @param playerNum
		 * @return   PlayerLabel from a player number.
		 */
		public static function getPlayerLabel(playerNum:int):String {
			return getInstance().getValue(PLAYER_LABEL+playerNum);
		}

		/**
		 * Return the client title.
		 *
		 * @return    Client title
		 */
		public static function getClientTitle():String {
			return getInstance().getValue(CLIENT_TITLE);
		}

		/**
		 * Return the title of this table.
		 *
		 * @return    Table title.
		 */
		public static function getTableTitle():String {
			return getInstance().getValue(TABLE_TITLE);
		}

		/**
		 * Return a welcome message.
		 *
		 * @return     Welcome message.
		 */
		public static function getWelcomeMessage():String {
			return getInstance().getValue(WELCOME_MESSAGE);
		}

		/**
		 * Return the name of the rules file
		 *
		 * @return   Rules filename
		 */
		public static function getRulesFilename():String {
			return getInstance().getValue(KEY_RULES_FILENAME,null);
		}

		/**
		 * Return the game label.
		 *
		 * @return
		 */
		public static function getGameLabel():String {
			return getInstance().getValue(GAME_LABEL,"!!! NOT SPECIFIED !!!");
		}
	}


}